{* Import css and javascript here *}
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/album.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/artist_detail.css" />
{*
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/comments.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/letter.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/top_rate.css" /> 
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/fancybox/jquery.fancybox.css" />
<script language=javascript src="{$smarty.const.THEME_RELATIVE}modules/fancybox/jquery.fancybox-1.2.1.pack.js"></script>
<script language=javascript src="{$smarty.const.THEME_RELATIVE}modules/fancybox/jquery.easing.1.3.js"></script> *}
<div class="albummodule">
		{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
		{if $permissions.administrate == 1}
			<a href="{link action=userperms _common=1}"><img src="{$smarty.const.ICON_RELATIVE}userperms.png" title="{$_TR.alt_userperm}" alt="{$_TR.alt_userperm}" /></a>
			<a href="{link action=groupperms _common=1}"><img src="{$smarty.const.ICON_RELATIVE}groupperms.png" title="{$_TR.alt_groupperm}" alt="{$_TR.alt_groupperm}" /></a>
		{/if}
		{if $permissions.configure == 1}
		        	<a href="{link action=configure _common=1}"><img src="{$smarty.const.ICON_RELATIVE}configure.png" title="{$_TR.alt_configure}" alt="{$_TR.alt_configure}" /></a>
		{/if}
		{if $permissions.configure == 1 or $permissions.administrate == 1}
			<br />
		{/if}
		{/permissions}

{if $moduletitle != ""}
<div class="format_title"><span>{$moduletitle}</span></div>
{/if}

	{foreach name=a from=$albums item=album}
	{math equation="x+1" x=$album->rank assign=prev}
	{math equation="x-1" x=$album->rank assign=next}
	{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
		<div class="itemactions">
			{if $permissions.configure == 1 or $permissions.administrate == 1}

			{if $smarty.foreach.a.first == 0 || $page > 1}
			<a href="{link action=rank_switch a=$album->rank b=$prev id=$album->id}">			
				<img src="{$smarty.const.ICON_RELATIVE}up.png" title="{$_TR.alt_previous}" alt="{$_TR.alt_previous}" />
			</a>
			{/if}

			<a href="{link action=edit id=$album->id}" title="Edit this entry">
				<img src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" />
			</a>
			<a href="{link action=delete_album id=$album->id}" title="Delete this entry">
				<img src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" />
			</a>


			{if $smarty.foreach.a.last == 0 }
			<a href="{link action=rank_switch a=$next b=$album->rank id=$album->id}">
				<img src="{$smarty.const.ICON_RELATIVE}down.png" title="{$_TR.alt_next}" alt="{$_TR.alt_next}" />
			</a>
			{/if}
			{/if}
		</div>
		{/permissions}
	<div class='data'>
    <table border='0' cellpadding='0' cellspacing='0' width="100%" {if $album->is_new ==1} style="background-image: url({$smarty.const.THEME_RELATIVE}images/new.png); background-position: top right; background-repeat: no-repeat;" {/if}>
        <tr>
            <td valign="top" width="80">
                <a id="album_image_{$album->id}" class='image' href='{link action=view id=$album->id}'>
                  <img src={if $album->picpath != ""} "{$smarty.const.PATH_RELATIVE}phpThumb.php?src={$album->picpath}&w=100&h=120"  {else} "{$smarty.const.PATH_RELATIVE}phpThumb.php?src={$smarty.const.THEME_RELATIVE}images/album.jpg&w=115&h=115" {/if} class="image_115_llista" />                </a>
            </td>
            <td valign="top">
            <div class="album_name">
                <table border='0' cellpadding='0' cellspacing='0' width="100%">
                    <tr>
                        <td>
                          <a id="album_link_{$album->id}" href='{link action=view id=$album->id name=$album->seo_name}'>
                          {$album->name}</a> - 
                          <span class="artist_name">
                {$album->publisher}                 		</span>
                        </td>
                        <td align=right>
                         {*add_to_cart id=$album->id name=$album->name notitle=1*}
                         &nbsp;
                        </td>
                    </tr>
               </table>
            </div>
            
            <div class="rating">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                      {* Rating here *}
                        <td width="40%" align="left">
                          {foreach from=$album->rate item=rate}
                              <img src='{$smarty.const.THEME_RELATIVE}images/star{$rate}.png'>
                          {/foreach}
                        </td>
                    </tr>
                </table>                                	
            </div>

   <table cellpadding="0" cellspacing="0" width="99%"  class="details">
        <tr>
            <td valign="top" width="33%">
                <table cellpadding="0" cellspacing="0" width="99%">
                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.Released}                        </td>
                        <td width=65% valign="top" class="value_detailed_album">{$album->released}</td>
                    </tr>
                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.Format}                        </td>
                        <td width=65% valign="top" class="value_detailed_album">
                        {$album->format_text}
                        </td>

                    </tr>
                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.type}</td>
                        <td width=65% valign="top" class="value_detailed_album">
                        {if $album->album_type == 0}
                        {$_TR.type_christian}
                        {else}{$_TR.type_other}
                        {/if} </td>
                    </tr>
                </table>

            </td>
            <td valign="top" width="33%">
                <table cellpadding="0" cellspacing="0" width="100%">
                   <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.length}</td>
                        <td width=65% valign="top" class="value_detailed_album">
                        {duration duration=$album->length}</td>

                    </tr>
                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.n0_disk}</td>
                        <td width=65% valign="top" class="value_detailed_album">
                        {$album->n0_disk}</td>
                    </tr>
                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.songs}</td>
                        <td width=65% valign="top" class="value_detailed_album">
                        {$album->musics}</td>
                    </tr>
                </table>
            </td>

            <td valign="top" width="33%">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.genre}</td>
                        <td width=65% valign="top" class="value_detailed_album">{$album->genre_text}</td>
                    </tr>

                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {if $album->for_sale > 0}{$_TR.price}{/if}&nbsp;
                        </td>
                        <td width=65% valign="top" class="value_detailed_album">
                        {if $album->for_sale > 0}{currency_symbol value=$album->price type=$album->currency_type}{/if}&nbsp;</td>
                    </tr>
                    <tr>
                        <td width=35% valign="top" class="label_detailed_album">
                        {$_TR.clicked}</td>
                        <td width=65% valign="top" class="value_detailed_album">
                        {$album->clicked}</td>
                    </tr>
                </table>
            </td>
            </tr>
            </table>

                        </td>
         </tr>
     </table>
	 
</div>
{foreachelse}
	<div><i>Chưa có album trong hệ thống</i></div>
{/foreach}	
<br>
<div align=center>{paging current_page=$page pages=$pages lang_page=$_TR.page lang_first=$_TR.first lang_last=$_TR.last action=view_page module=albummodule page_length=4 src=$__loc->src}</div>

{if $permissions.administrate == 1}
<div class="moduleactions">
    <a href="{link action=edit}">New album</a>
</div>
{/if}

</div>
